package com.springboot.demo.mapper;

import com.springboot.demo.entity.Admin;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface AdminMapper {
    public Admin login(@Param("telephone") String telephone, @Param("password") String password);

    public void register(@Param("nickname") String nickname
            ,@Param("telephone") String telephone
            ,@Param("password") String password);

    public void regiLibrarian(@Param("nickname") String nickname
            ,@Param("telephone") String telephone
            ,@Param("password") String password);

    public Admin regiSuccess(@Param("nickname") String nickname
            ,@Param("telephone") String telephone
            ,@Param("password") String password);

    public Admin hasAccount(@Param("phonenumber") String phonenumber);

    public void insertAdminAccount(@Param("nickname") String nickname
            ,@Param("telephone") String telephone
            ,@Param("password") String password);

    public void insertLibrarianAccount(@Param("nickname") String nickname
            ,@Param("telephone") String telephone
            ,@Param("password") String password);

    public void deleteAccount(@Param("phonenumber") String phonenumber);

    public Admin modify_pn(
            @Param("telephone") String telephone,  //原来的
            @Param("nickname") String nickname,
            @Param("password") String password
    );

    public void modify_tele(
            @Param("telephone") String telephone,  //原来的
            @Param("telephone1") String telephone1 //修改后的
    );

    public void delete(
            @Param("telephone") String telephone
    );

    public Admin check(
            @Param("telephone") String telephone
    );

    public Admin list_all();

    List<Admin> selectAll();

    public void modify_base(
            @Param("name") String name,
            @Param("value") int value
    );

    public Admin phone_fine(
            @Param("phone") String phone
    );

}
